# $Id: PKGBUILD 155876 2012-04-08 10:03:47Z giovanni $
# Maintainer: Giovanni Scafora <giovanni@archlinux.org> 
# Contributor: Biru Ionut <ionut@archlinux.ro>
# Contributor: Eric Belanger <eric@archlinux.org>
# Contributor: Aurelien Foret <orelien@chez.com>

pkgname=libtar
pkgver=1.2.11
pkgrel=4
pkgdesc="C library for manipulating POSIX tar files"
arch=('i686' 'x86_64')
url="http://www.feep.net/libtar/"
license=('BSD')
depends=('zlib')
source=("ftp://ftp.feep.net/pub/software/${pkgname}/${pkgname}-${pkgver}.tar.gz"
        'libtar-1.2.11-tar_header.patch'
        'libtar-1.2.11.patch')
md5sums=('604238e8734ce6e25347a58c4f1a1d7e'
         '94b03c0fdee20671e1f6d1ecaf187258'   
         'baef7da841c186e1830566296859c35b')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  export CFLAGS+=" -fPIC"

  # Fix FS#29322
  patch -Np1 -i "${srcdir}/libtar-1.2.11-tar_header.patch"

  patch -Np1 -i "${srcdir}/libtar-1.2.11.patch"
  ./configure --prefix=/usr \
              --mandir=/usr/share/man
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make DESTDIR="${pkgdir}" install
  install -D -m644 COPYRIGHT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
